home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_enscript.idb / usr / freeware / info / enscript.info.z / enscript.info (.txt)
GNU Info File  |  2002-04-08  |  12KB  |  326 lines

  1. This is Info file enscript.info, produced by Makeinfo version 1.68 from
  2. the input file enscript.texi.
  3. INFO-DIR-SECTION Utilities
  4. START-INFO-DIR-ENTRY
  5. * Enscript: (enscript).            GNU Enscript
  6. END-INFO-DIR-ENTRY
  7.    This file documents GNU enscript 1.6.3
  8.    Copyright (C) 1995-1999 Markku Rossi.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that
  14. the entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Foundation.
  20. File: enscript.info,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
  21. GNU enscript
  22. ************
  23.    This file documents the GNU enscript program.  This edition documents
  24. version 1.6.3.
  25. * Menu:
  26. * Introduction::
  27. * Invoking Enscript::
  28. * Basic Printing::
  29. * Advanced Usage::
  30. * Configuration Files::
  31. * Customization::
  32. * The states Program::
  33. * Writing New Highlighting Definitions::
  34. * Index::
  35. File: enscript.info,  Node: Introduction,  Next: Invoking Enscript,  Prev: Top,  Up: Top
  36. Introduction
  37. ************
  38.    * overall
  39.    * design
  40. File: enscript.info,  Node: Invoking Enscript,  Next: Basic Printing,  Prev: Introduction,  Up: Top
  41. Invoking Enscript
  42. *****************
  43. File: enscript.info,  Node: Basic Printing,  Next: Advanced Usage,  Prev: Invoking Enscript,  Up: Top
  44. Basic Printing
  45. **************
  46. * Menu:
  47. * Input Encodings::
  48. * Selecting Fonts::
  49. * Page Headers::
  50. * Page Handling::
  51. * Highlighting::
  52. File: enscript.info,  Node: Input Encodings,  Next: Selecting Fonts,  Prev: Basic Printing,  Up: Basic Printing
  53. Input Encodings
  54. ===============
  55. File: enscript.info,  Node: Selecting Fonts,  Next: Page Headers,  Prev: Input Encodings,  Up: Basic Printing
  56. Selecting Fonts
  57. ===============
  58. File: enscript.info,  Node: Page Headers,  Next: Page Handling,  Prev: Selecting Fonts,  Up: Basic Printing
  59. Page Headers
  60. ============
  61. File: enscript.info,  Node: Page Handling,  Next: Highlighting,  Prev: Page Headers,  Up: Basic Printing
  62. Page Handling
  63. =============
  64. * Menu:
  65. * Page Orientation::
  66. * N-up Printing::
  67. * Fitting Text to Page::
  68. File: enscript.info,  Node: Page Orientation,  Next: N-up Printing,  Prev: Page Handling,  Up: Page Handling
  69. Page Orientation
  70. ----------------
  71. File: enscript.info,  Node: N-up Printing,  Next: Fitting Text to Page,  Prev: Page Orientation,  Up: Page Handling
  72. N-up Printing
  73. -------------
  74. File: enscript.info,  Node: Fitting Text to Page,  Prev: N-up Printing,  Up: Page Handling
  75. Fitting Text to Page
  76. --------------------
  77. File: enscript.info,  Node: Highlighting,  Prev: Page Handling,  Up: Basic Printing
  78. Highlighting
  79. ============
  80. * Menu:
  81. * Different Output Languages::
  82. File: enscript.info,  Node: Different Output Languages,  Prev: Highlighting,  Up: Highlighting
  83. Different Output Languages
  84. --------------------------
  85. File: enscript.info,  Node: Advanced Usage,  Next: Configuration Files,  Prev: Basic Printing,  Up: Top
  86. Advanced Usage
  87. **************
  88. * Menu:
  89. * Selecting Pages::
  90. * Escape Sequences::
  91. * Input Filters::
  92. * Slice Printing::
  93. * PostScript Printer Controlling::
  94. * Pass-Through Mode::
  95. File: enscript.info,  Node: Selecting Pages,  Next: Escape Sequences,  Prev: Advanced Usage,  Up: Advanced Usage
  96. Selecting Pages
  97. ===============
  98. File: enscript.info,  Node: Escape Sequences,  Next: Input Filters,  Prev: Selecting Pages,  Up: Advanced Usage
  99. Escape Sequences
  100. ================
  101. File: enscript.info,  Node: Input Filters,  Next: Slice Printing,  Prev: Escape Sequences,  Up: Advanced Usage
  102. Input Filters
  103. =============
  104. File: enscript.info,  Node: Slice Printing,  Next: PostScript Printer Controlling,  Prev: Input Filters,  Up: Advanced Usage
  105. Slice Printing
  106. ==============
  107. File: enscript.info,  Node: PostScript Printer Controlling,  Next: Pass-Through Mode,  Prev: Slice Printing,  Up: Advanced Usage
  108. PostScript Printer Controlling
  109. ==============================
  110. File: enscript.info,  Node: Pass-Through Mode,  Prev: PostScript Printer Controlling,  Up: Advanced Usage
  111. Pass-Through Mode
  112. =================
  113. File: enscript.info,  Node: Configuration Files,  Next: Customization,  Prev: Advanced Usage,  Up: Top
  114. Configuration Files
  115. *******************
  116. File: enscript.info,  Node: Customization,  Next: The states Program,  Prev: Configuration Files,  Up: Top
  117. Customization
  118. *************
  119. * Menu:
  120. * Output Media::
  121. * User-Defined Fancy Headers::
  122. File: enscript.info,  Node: Output Media,  Next: User-Defined Fancy Headers,  Prev: Customization,  Up: Customization
  123. Output Media
  124. ============
  125. File: enscript.info,  Node: User-Defined Fancy Headers,  Prev: Output Media,  Up: Customization
  126. User-Defined Fancy Headers
  127. ==========================
  128. File: enscript.info,  Node: The states Program,  Next: Writing New Highlighting Definitions,  Prev: Customization,  Up: Top
  129. The `states' Program
  130. ********************
  131. File: enscript.info,  Node: Writing New Highlighting Definitions,  Next: Index,  Prev: The states Program,  Up: Top
  132. Writing New Highlighting Definitions
  133. ************************************
  134.    The highlighting works in three separate phases.  First, the
  135. "highlighing rules" process the input stream and parse it into logical
  136. components.  The components are called "faces".  A face presents one
  137. logical component of the input language, for example, a keyword, a
  138. comment, etc..  The enscript's highlighting model defines the following
  139. faces:
  140. italic
  141. bold_italic
  142.      Hard-coded faces for the bold, italic, and bold-italice text types.
  143.      These faces define the exact presentation of the face font, so the
  144.      style files have very little power in customizing their outlook.
  145.      These faces should be avoided as much as possible.
  146. comment
  147.      A comment, normally in a programming language.
  148. function_name
  149.      A function name.  The function names are normally recognized from
  150.      function definitions, not from an use of the function.
  151. variable_name
  152.      A variable name.  The variable names are normally recognized from
  153.      function, type, and variable definitions.
  154. keyword
  155.      A reserved keyword.  Normally, all occurrences of the keywords are
  156.      recognized.
  157. reference
  158.      A reference to another location in a file or to another file or
  159.      resource.  For example, in the C-language, the goto targets are
  160.      references.
  161. string
  162.      A string literal.
  163. builtin
  164.      A builtin function or property.  Normally, all occurrences of the
  165.      builtins are recognized.
  166.      A type specifier.  The types are normally recognized from function,
  167.      type, and variable definitions.
  168.    As the second step, the "output style" specifies how the faces are
  169. presented in the generated output.  Each face has the following
  170. properties:
  171. fontname
  172.      The PostScript font name of the the font that is used for the face.
  173.      This property is used only for the PostScript outputs.
  174. boldp
  175.      A boolean flag which tells whether the face should be printed in
  176.      bold font.  This property is used for all output languages except
  177.      for the PostScript which uses the fontname property.
  178. italicp
  179.      A boolean flag which tells whether the face shuold be printed with
  180.      italic font.  This property is used for all output languages
  181.      except for the PostScript which uses the fontname property.
  182. fg_color
  183.      The foreground color of the face.
  184. bg_color
  185.      The background color of the face.  This property is not
  186.      implemented on all output languages.
  187.    Finally, the "output language" describes how the faces and other
  188. text are presented in the output language.  The output language defines
  189. a set of functions which are called to generate the output.
  190. * Menu:
  191. * Highlighting Rules::
  192. * Styles::
  193. * Output Languages::
  194. File: enscript.info,  Node: Highlighting Rules,  Next: Styles,  Prev: Writing New Highlighting Definitions,  Up: Writing New Highlighting Definitions
  195. Highlighting Rules
  196. ==================
  197. File: enscript.info,  Node: Styles,  Next: Output Languages,  Prev: Highlighting Rules,  Up: Writing New Highlighting Definitions
  198. Styles
  199. ======
  200. File: enscript.info,  Node: Output Languages,  Prev: Styles,  Up: Writing New Highlighting Definitions
  201. Output Languages
  202. ================
  203.  - Function: map_color (R, G, B)
  204.  - Function: language_print (STRING)
  205.  - Function: language_symbol (SYMBOL)
  206.  - Function: header ()
  207.  - Function: trailer ()
  208.  - Function: face_on (FACE)
  209.  - Function: face_off (FACE)
  210.  - Variable: LANGUAGE_SPECIALS
  211.    The following example creates a new output language `simple_html'
  212. that creates simple HTML outputs.  The output language is defined in a
  213. file called `lang_simple_html.st'.  The file must define a state called
  214. `lang_simple_html'.  The file can be located in any directory that is
  215. in the load path of the states program.
  216.    The output language definitions are defined in the `BEGIN' block of
  217. the `lang_simple_html' state.  Please, note that the `BEGIN' block is
  218. ended with a `return'-statement.  This statement will return the
  219. control to the calling state that is the start state of the enscript
  220. highlight program.  If the `return'-statement was omitted, the states
  221. would start processing the input with the `lang_simple_html' state
  222. which is obviously a wrong choice.
  223.      state lang_simple_html
  224.      {
  225.        BEGIN {
  226.          sub map_color (r, g, b)
  227.          {
  228.            return sprintf ("#%02X%02X%02X", r, g, b);
  229.          }
  230.      
  231.          sub language_print (str)
  232.          {
  233.            str = regsuball (str, /\&/, "&");
  234.            str = regsuball (str, /</, "<");
  235.            str = regsuball (str, />/, ">");
  236.            str = regsuball (str, /\"/, """);
  237.            print (str);
  238.          }
  239.      
  240.          sub language_symbol (symbol)
  241.          {
  242.            return false;
  243.          }
  244.      
  245.          sub header ()
  246.          {
  247.            print ("<html>\n<head>\n<title>Simple HTML Output</title>\n");
  248.            print ("</head>\n<body>\n");
  249.          }
  250.      
  251.          sub trailer ()
  252.          {
  253.            print ("</body>\n</html>\n");
  254.          }
  255.      
  256.          sub fase_on (face)
  257.          {
  258.            if (face(boldp])
  259.              print ("<B>");
  260.            if (face(italicp])
  261.              print ("<I>");
  262.            if (face[fg_color])
  263.              print ("<FONT COLOR=\", face[fg_color], "\">");
  264.          }
  265.      
  266.          sub face_off (face)
  267.          {
  268.            if (face[fg_color])
  269.              print ("</FONT>");
  270.            if (face[italicp])
  271.              print ("</I>");
  272.            if (face[boldp])
  273.              print ("</B>");
  274.          }
  275.      
  276.          LANGUAGE_SPECIALS = /[<>\&\"]/;
  277.      
  278.          return;
  279.        }
  280.      }
  281. File: enscript.info,  Node: Index,  Prev: Writing New Highlighting Definitions,  Up: Top
  282. Index
  283. *****
  284. * Menu:
  285. * face_off:                              Output Languages.
  286. * face_on:                               Output Languages.
  287. * header:                                Output Languages.
  288. * language_print:                        Output Languages.
  289. * LANGUAGE_SPECIALS:                     Output Languages.
  290. * language_symbol:                       Output Languages.
  291. * map_color:                             Output Languages.
  292. * trailer:                               Output Languages.
  293. Tag Table:
  294. Node: Top
  295. Node: Introduction
  296. Node: Invoking Enscript
  297. Node: Basic Printing
  298. Node: Input Encodings
  299. Node: Selecting Fonts
  300. Node: Page Headers
  301. Node: Page Handling
  302. Node: Page Orientation
  303. Node: N-up Printing
  304. Node: Fitting Text to Page
  305. Node: Highlighting
  306. Node: Different Output Languages
  307. Node: Advanced Usage
  308. Node: Selecting Pages
  309. Node: Escape Sequences
  310. Node: Input Filters
  311. Node: Slice Printing
  312. Node: PostScript Printer Controlling
  313. Node: Pass-Through Mode
  314. Node: Configuration Files
  315. Node: Customization
  316. Node: Output Media
  317. Node: User-Defined Fancy Headers
  318. Node: The states Program
  319. Node: Writing New Highlighting Definitions
  320. Node: Highlighting Rules
  321. Node: Styles
  322. Node: Output Languages
  323. Node: Index
  324. 11020
  325. End Tag Table
  326.